a = int(input())
b = int(input())
c = int(input())
d = int(input())
if a * d == b * c or a * c == b * d:
    print(1)
else:
    print(0)